<template>
  <view class="notice-detail">
    <view class="meta">
      <view class="title">{{ detail.title }}</view>
      <view class="time">{{ detail.createTime }}</view>
    </view>

    <!-- 富文本 -->
    <!-- 把 rich-text 整个替换成下面这一行 -->
    <mp-html :content="detail.content" />
  </view>
</template>

<script>
export default {
  data() {
    return {
      detail: {},    // 直接从上级页面带过来
      richNodes: []
    };
  },
  onLoad(options) {
    // 直接解析，不用再请求
    this.detail = JSON.parse(decodeURIComponent(options.item));

  },

};
</script>

<style lang="scss" scoped>
.notice-detail {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #fff;
}
.meta {
  padding: 30rpx;
  border-bottom: 1rpx solid #eee;
  .title {
    font-size: 36rpx;
    font-weight: 600;
    margin-bottom: 10rpx;
  }
  .time {
    font-size: 28rpx;
    color: #999;
  }
}
.content-wrapper {
  flex: 1;
  padding: 30rpx;
  line-height: 1.8;
  font-size: 32rpx;
  color: #333;
}
</style>